var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var a in t) t.hasOwnProperty(a) && (e[a] = t[a]);
    })(e, t);
}, function(e, t) {
    function a() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (a.prototype = t.prototype, 
    new a());
}), a = this && this.__decorate || function(e, t, a, n) {
    var o, r = arguments.length, s = r < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n); else for (var c = e.length - 1; 0 <= c; c--) (o = e[c]) && (s = (r < 3 ? o(s) : 3 < r ? o(t, a, s) : o(t, a)) || s);
    return 3 < r && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameData"), s = e("AudioManager"), c = e("DataManager"), l = e("RecorderManager"), d = e("UIManager"), u = e("WebManager"), p = e("PrefabView"), h = cc._decorator, f = h.ccclass, g = h.property, m = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.sprite = null, e;
    }
    return i(e, t), e.prototype.onClickBack = function() {
        s.default.getInstance().playAudio("按钮2"), this.hidePnl();
    }, e.prototype.onClickRecorder = function() {
        var t = this;
        s.default.getInstance().playAudio("按钮2"), u.default.getInstance().sentLog("TryShareVideo"), 
        l.default.getInstance().isRecorder || (GA.isPlatform(GA.Platform.ByteDance) ? (l.default.getInstance().isRecorder = !0, 
        GA.PA.shareAppMessage({
            channel: "video",
            title: "我就要吃鸡",
            desc: "进入吃鸡的世界",
            imageUrl: "",
            templateId: "3eld33adx4d3bk46j6",
            query: "krq_wjycj=10002",
            extra: {
                videoPath: l.default.getInstance().videoPath,
                videoTopics: [ "我就要吃鸡", "卡日曲游戏" ],
                withVideoId: !0,
                createChallenge: !1
            },
            success: function(e) {
                u.default.getInstance().sentLog("ShareVideoSuccess"), r.GD.updateNumber("diamond", 50), 
                d.default.getInstance().showToast({
                    diamond: 50
                }), c.default.getInstance().save(), e.videoId && u.default.getInstance().saveVideoId({
                    aliasId: e.videoId,
                    success: function(e) {
                        console.log("保存视频成功:", e);
                    }
                }), console.log("分享视频成功:", e), t.hidePnl();
            },
            fail: function(e) {
                u.default.getInstance().sentLog("ShareVideoFailed"), l.default.getInstance().isRecorder = !1, 
                "shareAppMessage:cancel" == e.errMsg || "shareAppMessage:fail video duration is too short" == e.errMsg && d.default.getInstance().showToast({
                    str: "抱歉,录屏时间太短！"
                }), console.log("分享视频失败:", e);
            }
        })) : GA.isPlatform(GA.Platform.Kwaigame) && (l.default.getInstance().isRecorder = !0, 
        l.default.getInstance().publishVideo({
            mouldId: "2300000582",
            video: l.default.getInstance().videoId,
            callback: function(e) {
                null == e ? (r.GD.updateNumber("diamond", 50), d.default.getInstance().showToast({
                    diamond: 50
                }), c.default.getInstance().save(), t.hidePnl()) : l.default.getInstance().isRecorder = !1;
            }
        })));
    }, e.prototype.start = function() {
        l.default.getInstance().spriteFrame && (this.sprite.spriteFrame = l.default.getInstance().spriteFrame);
    }, a([ g(cc.Sprite) ], e.prototype, "sprite", void 0), a([ f ], e);
}(p.default);

n.default = m;